@inherits RenderViewPage
@using Umbraco.Cms.Web
@using PBDesk.com.WebSite.Helpers

@{
  var dummyNodesContainer =  Model.ChildContent().Where(p => p.ContentType.Alias == "dummy"); 
  var topBannerNodes = dummyNodesContainer.FirstOrDefault().ChildContent().Where(p => p.ContentType.Alias == "widget" && p.DynamicField("widgetType") == "top").Take(3);
  var grayBannerNodes = dummyNodesContainer.FirstOrDefault().ChildContent().Where(p => p.ContentType.Alias == "widget" && p.DynamicField("widgetType") == "gray").Take(3);
  var bottomBannerNodes = dummyNodesContainer.FirstOrDefault().ChildContent().Where(p => p.ContentType.Alias == "widget" && p.DynamicField("widgetType") == "bottom").Take(3);
}
<div id="contents">
  @if (topBannerNodes.Count() > 0)
  {
	@Html.Partial("Rambling/Banners", new ViewDataDictionary { { "BannerType", "top" }, { "BannerNodes", topBannerNodes } } )
  } 
  <div id="homepage">          
    <div class="services">
     @Html.Partial("Common/SocialBadge")
    </div>
    <div>
      @Html.Partial("Rambling/Slider")
      @Html.Partial("Rambling/DisplayPost")
    </div>
    <div class="clear"></div>
    <div class="googleAd-bottom">
      @Html.Partial("ads/ad728x90")
    </div>
  </div>
  <div class="clear"></div>

	@if (grayBannerNodes.Count() > 0)
 { 
	 @Html.Partial("Rambling/Banners", new ViewDataDictionary { { "BannerType", "gray" }, { "BannerNodes", grayBannerNodes } } )
 }
	@if (bottomBannerNodes.Count() > 0)
 { 
	 @Html.Partial("Rambling/Banners", new ViewDataDictionary { { "BannerType", "bottom" }, { "BannerNodes", bottomBannerNodes } } )
 }
</div>